#ifndef WIDGET_STUDENT_LIST_VIEW_ITEM_H
#define WIDGET_STUDENT_LIST_VIEW_ITEM_H

#include <QWidget>
#include <QString>
#include <QPushButton>
#include <QFrame>
#include <QPainter>


namespace Ui {
class widget_student_list_view_item;
}

class widget_student_list_view_item : public QWidget
{
    Q_OBJECT
    
public:
    explicit widget_student_list_view_item(QWidget *parent = 0,
                                           QString studentName = QString(),
                                           QString testStartTime = QString(),
                                           QString testName = QString(),
                                           int completionPercent = -1,
                                           int confidencePercent = -1);
    ~widget_student_list_view_item();

    void hide_chat_icon();
signals:
    void clicked(QMouseEvent * e);


private slots:
    void on_viewDetails_clicked();


private:
    Ui::widget_student_list_view_item *ui;
    void mouseReleaseEvent(QMouseEvent *);
    void mousePressEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);
    bool mousedown;
};

class QFrameButton: public QFrame
{
    Q_OBJECT

public:
    QFrameButton(QWidget * parent): QFrame(parent){
        setFrameStyle(QFrame::StyledPanel);

        QPalette qp = this->palette();
        QSize qsize = this->size();
        QLinearGradient qg(qsize.width()/2,0,qsize.width()/2,qsize.height());
        qg.setColorAt(0, QColor(220,220,220));
        qg.setColorAt(1.0, QColor(150,150,150));
        QBrush brush(qg);
        qp.setBrush(QPalette::Window,  brush);

        this->setPalette(qp);
        this->update();

        //ui->frame->setFrameStyle(QFrame::StyledPanel);
    }

protected:
    void paintEvent(QPaintEvent*pe){
        QFrame::paintEvent(pe);
        QPainter p(this);

//        QPainter p(this);
//        p.drawRect();
    }

};

#endif // WIDGET_STUDENT_LIST_VIEW_ITEM_H
